<style>
    table, th, tr, td {
        border: 1px solid #ccc;
        font-size: 14px;
    }
    .ordertable{
        width: 95%;
        margin: 0 auto;
        border-radius: 10px;
    }
    .tablebox1{
        padding-top: 10px;
    }
    .payorder{
        display: flex;
        justify-content: center;
        height: 50px;
        line-height: 40px;
        font-size: 18px;
    }
    .paygoods{
        display: flex;
        justify-content: center;
        height: 50px;
        line-height: 40px;
        font-size: 18px;
    }
    .ordertable tr td{
        line-height: 30px;
        text-align: center;
    }
</style>
<script src="../../static/js/jquery-3.1.1.min.js"></script>
<div class="layuimini-container">
    <div class="tablebox">
        <div class="payorder">基本信息</div>
        <table class="ordertable">
            <tr>
                <td style="width: 15%;">订单编号：</td>
                <td style="width: 15%;">{$orderinfo.ordersn}</td>
                <td style="width: 20%">下单时间：</td>
                <td style="width: 20%">{$orderinfo.create_time|date='Y-m-d H:i:s'}</td>
                <td style="width: 15%;">下单用户：</td>
                <td style="width: 15%;">{$row.nickName}</td>
            </tr>
            <tr>
                <td style="width: 15%;">微信标识：</td>
                <td style="width: 15%;">{$orderinfo.openid}</td>
                <td style="width: 20%">收货人姓名：</td>
                <td style="width: 20%;">{$orderinfo.realname}</td>
                <td style="width: 15%;">收货电话：</td>
                <td style="width: 15%;">{$orderinfo.mobile}</td>
            </tr>
            <tr>
                <td style="width: 15%;">收货方式：</td>
                <td style="width: 25%;">{if condition="$orderinfo['shippingtype']==1"}商家邮寄{else/}到店核销{/if}</td>
                <td style="width: 15%;">支付方式：</td>
                <td style="width: 25%;">{if condition="$orderinfo['paytype']==1"}微信支付{else/}余额支付{/if}</td>
                <td style="width: 15%">详细地址：</td>
                <td style="width: 25%;">{$orderinfo.address}</td>
            </tr>
            <tr>
                <td style="width: 15%;">订单状态：</td>
                <td style="width: 15%;">{$orderinfo.statusname}</td>
                <td style="width: 20%;">支付时间：</td>
                <td style="width: 20%;">{if condition="$orderinfo['paytime'] neq ''"}{$orderinfo.paytime|date='Y-m-d H:i:s'}{else/}--{/if}</td>
                <td style="width: 15%;">发货时间：</td>
                <td style="width: 15%;">{if condition="$orderinfo['shipping_time'] neq ''"}{$orderinfo.shipping_time|date='Y-m-d H:i:s'}{else/}--{/if}</td>
            </tr>
            <tr>
                <td style="width: 15%;">收货时间：</td>
                <td style="width: 15%;">{if condition="$orderinfo['confirm_time'] neq ''"}{$orderinfo.confirm_time|date='Y-m-d H:i:s'}{else/}--{/if}</td>
                <td style="width: 20%;">取消时间：</td>
                <td colspan="3">{if condition="$orderinfo['canseltime'] neq ''"}{$orderinfo.canseltime|date='Y-m-d H:i:s'}{else/}--{/if}</td>
            </tr>
        </table>
    </div>
    <div class="tablebox1">
        <div class="paygoods">购买商品</div>
        <table class="ordertable" style="padding-top: 10px;">
            <tr>
                <td style="width: 20%;">商品名称</td>
                <td style="width: 20%;">图片</td>
                <td style="width: 20%">商品价格</td>
                <td style="width: 20%">购买数量</td>
            </tr>
            {foreach name="goodslist" item="val"}
            <tr>
                <td style="width: 20%;">{$val.goods_name}</td>
                <td style="width: 20%;"><img src="{$val.logo}" style="padding: 10px;" width="100" height="100"></td>
                <td style="width: 20%">￥{$val.price}</td>
                <td style="width: 20%">X{$val.total}</td>
            </tr>
            {/foreach}
            <tr>
                <td style="width: 20%;">商品合计：</td>
                <td colspan="5">￥{$orderinfo.orderprice}</td>
            </tr>
            <tr>
                <td style="width: 20%;">运费金额：</td>
                <td colspan="5">￥{$orderinfo.shippingfee}</td>
            </tr>
            <tr>
                <td style="width: 20%;">折扣金额：</td>
                <td colspan="5">￥{$orderinfo.discountprice}</td>
            </tr>
            <tr>
                <td style="width: 20%;">应付金额：</td>
                <td colspan="5">￥{$orderinfo.payprice}</td>
            </tr>
        </table>
    </div>
    <div class="hr-line"></div>
    <div class="tablebox">
        <div class="payorder">申请售后详情</div>
        <table class="ordertable">
            <tr>
                <td style="width: 15%;">退货方式：</td>
                <td style="width: 15%;">{$row.refund_type}</td>
                <td style="width: 20%">退款原因：</td>
                <td style="width: 20%">{$row.refund_reason}</td>
                <td style="width: 15%;">联系电话：</td>
                <td style="width: 15%;">{$row.mobile}</td>
            </tr>
            <tr>
                <td style="width: 15%;">售后备注：</td>
                <td style="width: 15%;" colspan="3">{$row.remark}</td>
            </tr>
            <tr {if condition="$row['refund_imgs'] !=[]"}>
                <td style="width: 15%;">上传图片：</td>
                <td style="width: 15%;" colspan="5">
                    {foreach name="$row['refund_imgs']" item="val"}
                    <img src="{$val.url}" style="width:100px; height: 100px;">
                    {/foreach}
                </td>
            </tr>

        </table>
    </div>
    <div class="hr-line"></div>
    {if condition="$row['status'] == 0"}
    <form id="app-form" class="layui-form layuimini-form">
        <div class="hr-line"></div>
        <div id="shippingbox">
            <div class="layui-form-item">
                <label class="layui-form-label">输入退款金额</label>
                <div class="layui-input-block">
                    <input type="text" name="realrefund_money" class="layui-input" placeholder="请输入输入退款金额" value="{$orderinfo.payprice}">
                    <tip>退款金额不能大于实际支付金额</tip>
                </div>
            </div>
        </div>
        <div class="layui-form-item text-center">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit>确认退款</button>
        </div>
    </form>
    {/if}
</div>
